#include "ActionQueue.h"

#define CACTION_NAME (L"CACTION_QUEUE")

CActionQueue::CActionQueue(void)
{
	pQueue = new CQueue<ActionInfo>(CACTION_NAME);
}

CActionQueue::~CActionQueue(void)
{
	if(pQueue) 
	{
		delete pQueue;
		pQueue = 0;
	}
}

bool CActionQueue::Write( const ActionInfo& info, unsigned long nTimeOut /*= 100*/ )
{
	return pQueue->Insert(info, nTimeOut);
}

ActionInfo CActionQueue::Read( unsigned long nTimeOut /*= 100*/ )
{
	return pQueue->Pickup(nTimeOut);
}